<%@ page import="com.pml.vo.Emp" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="com.pml.factory.DAOFactory" %><%--
  Created by IntelliJ IDEA.
  User: 迷路的麋鹿
  Date: 2018/4/20
  Time: 20:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("gbk");
    Emp emp=new Emp();
    emp.setEmpno(Integer.valueOf(request.getParameter("empno")));
    emp.setEname(request.getParameter("ename"));
    emp.setJob(request.getParameter("job"));
    emp.setHiredate(new SimpleDateFormat("yyyy-MM-dd").parse(request.getParameter("hiredate")));
    emp.setSal(Float.parseFloat(request.getParameter("sal")));
    try{
        if (new DAOFactory().getEmpDAOInstance().doCreate(emp)){
%>
雇员信息添加成功！
<%      }else{
%>注册失败！

<%
        }

    }catch (Exception e){
        e.printStackTrace();
    }
%>
</body>
</html>
